home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / rbbs / rbbs_mpl.zip / RCHAT300.STB < prev    next >
Text File  |  1992-03-08  |  5KB  |  162 lines

  1. '
  2. ' RChat300  --  Or, RBBS-Chat, release 3.00.  A character by character
  3. '               internode chat program..
  4. '
  5. '  Not the worlds prettiest, or cleanest code.. but I'm under no illusions..
  6. '
  7. '  Copyright 1989-1990 By John Morris  All Rights Reserved
  8. '  modifications for rbbs17.4 by Pete Eibl
  9. '
  10. '  I'm not a big fan of global variables, but here goes..
  11. '
  12. '  $INCLUDE: 'RBBS-VAR.MOD'   'RBBS-VAR.BAS minus the DEF FN...
  13. '
  14.    DEFINT A - Z
  15.    COMMON Shared /Chat/ DoTrueChat, HasPaged, UpperNode, LowerNode, SaveToDisk
  16.    COMMON Shared /Chat/ NodesToSquelch$
  17.    COMMON SHARED /ChatField/ ChatActivity$, PagingNode$, PrivateFor$
  18.    COMMON SHARED /ChatField/ ChatInput$, ChatName$, InTrueChat$
  19.    COMMON SHARED /ChatField/ TrueChatIndex$, SavingToDisk$, BBSActivity$
  20. '
  21. 59800 ' $SUBTITLE: 'LogNewForChat - Save user info for chat'
  22. ' $PAGE
  23. '
  24. '  NAME    -- LogNewForChat
  25. '
  26. '  INPUTS  -- Zmaxnodes -- needed for creation of RBBSCHAT.DEF
  27. '
  28. '  OUTPUTS -- Updates the node record in RBBSCHAT.DEF with this users
  29. '             name and chat activity (always "I") when the user logs on.
  30. '
  31. '  PURPOSE -- See OUTPUTS. Also, if no RBBSCHAT.DEF is not found, one will be
  32. '             created.
  33. '
  34.       SUB LogNewForChat(ZMaxNodes) STATIC
  35.       CALL FindItX (ZChatFileName$, 9)
  36.       REM ** If "RBBSCHAT.DEF" does not exist, then create it **
  37.  
  38.       IF NOT ZOK THEN
  39.          CALL OpenWrk9 (ZChatFileName$)
  40.          FIELD 9, 128 AS TempNode$
  41.          LSET TempNode$ = SPACE$(128)
  42.          FOR Index = 1 TO ZMaxNodes
  43.             CALL LockIt9 (Index, ZFalse)
  44.          NEXT
  45.       END IF
  46.  
  47.       ChatIndex = ZNodeRecIndex - 1
  48.       CLOSE 9
  49.       CALL OpenWrk9 (ZChatFileName$)
  50.       CALL Field9
  51.       CALL LockIt9 (ChatIndex, ZTrue)
  52.       LSET ChatActivity$ = "I"    ' I means inactive
  53.       LSET PagingNode$ = MKI$(0)
  54.       LSET ChatName$ = SPACE$(31)
  55.  
  56.       IF ZActiveUserName$ = ZSysopPswd1$ + " " + ZSysopPswd2$ THEN
  57.          LSET ChatName$ = "SYSOP"
  58.        ELSE
  59.          LSET ChatName$ = ZActiveUserName$
  60.       END IF
  61.  
  62.       LSET ChatInput$ = SPACE$(72)
  63.       LSET InTrueChat$ = "I"
  64.       CALL LockIt9 (ChatIndex, ZFalse)
  65.       CLOSE 9
  66.       END SUB
  67.  
  68. 59810 ' $SUBTITLE: 'CBCHECK - Check for a page attempt'
  69. ' $PAGE
  70. '
  71. '  NAME    -- CBCHECK
  72. '
  73. '  INPUTS  -- NONE
  74. '
  75. '  OUTPUTS -- ChatActivity$   Changed to reflect whether or not they
  76. '                             are going to chat
  77. '             WillChat        If WillChat is TRUE, then the user will
  78. '                             automatically be thrust unawares into
  79. '                             chat mode.. They said yes... didn't they?
  80. '
  81. '  PURPOSE -- Check to see if we have been paged from another node
  82. '
  83.       SUB CBCheck(WillChat) STATIC
  84.       WillChat = ZFalse
  85.       exit sub
  86.       END SUB
  87.  
  88. 59830 ' $SUBTITLE: 'CBTrueChat - The letter by letter chat'
  89. ' $PAGE
  90. '
  91. '  NAME    -- CBTrueChat
  92. '
  93. '  INPUTS  -- Zmaxnodes
  94. '
  95. '  INTERNAL - NodesToSquelch$      STRING OF NODES NOT TO RECEIVE TEXT FROM
  96. '             HasPaged             NODE (IF ANY) THAT THIS USER PAGED
  97. '             CurrentNodeIndex     NODE RECORD IN "RBBSCHAT.DEF"
  98. '             ChatActivity$        CURRENT STATUS OF EACH NODE
  99. '             PagingNode$          NODE WHICH HAS PAGED THIS ONE
  100. '             ChatInput$           CURRENT TEXT INPUT BY USER FOR CHATTING
  101. '             ChatName$            NAME OF USER ON EACH NODE (NOT CURRENTLY USED)
  102. '             SquelchIt            BOOLEAN - MEANS NODE IS IGNORED
  103. '             ZUserIn$()           USED TO SAVE CURRENT STATUS OF EACH NODE
  104. '                                  THIS INFO IS LATER COMPARED, AND IF THAT
  105. '                                  STATUS IS CHANGED, THEN THE USER IS NOTIFIED
  106. '                                  OF THE CHANGE
  107. '             DoTrueChat           Means we are in a true chat mode, we'll
  108. '                                  only check one node for input
  109. '
  110. '
  111. '  OUTPUTS -- NONE
  112. '
  113. '  PURPOSE -- To allow users to chat between nodes in several different
  114. '             ways.
  115. '
  116.       SUB CBTrueChat(Zmaxnodes) STATIC
  117.        CALL QuickTput1 ( "Chat Not avaiable on this system")
  118.     Exit Sub
  119.     End Sub
  120.  
  121.     
  122.  
  123. REM **
  124. REM ** Save what a user is doing in the BBS.. for W)hos on mods..... **
  125. REM **
  126. 59910 SUB SaveUserActivity(Activity$, NodeRecordIndex, ReadIt) STATIC
  127.  
  128.       ChatNodeIndex = NodeRecordIndex - 1
  129.  
  130.       CLOSE 9
  131.       CALL OpenWrk9 (ZChatFileName$)
  132.       CALL Field9
  133.  
  134.       IF ReadIt THEN
  135.          CALL LockIt9(ChatNodeIndex, ZTrue)
  136.          Activity$ = BBSActivity$
  137.        ELSE
  138.          CALL LockIt9(ChatNodeIndex, ZTrue)
  139.          LSET BBSActivity$ = Activity$
  140.          CALL LockIt9(ChatNodeIndex, ZFalse)
  141.       END IF
  142.  
  143.       IF NOT ReadIt THEN
  144.          CLOSE 9
  145.       END IF
  146.  
  147.       END SUB
  148.  
  149. 59990 SUB Field9 STATIC
  150.       REM ** all of these variables are SHARED between all subprograms in **
  151.       REM ** this module (RCHAT300.BAS)                                   **
  152.       FIELD 9, 1 AS ChatActivity$, _
  153.                2 AS PagingNode$,   _
  154.                2 AS PrivateFor$,   _
  155.               72 AS ChatInput$,    _
  156.               31 AS ChatName$,     _
  157.                1 AS InTrueChat$,   _
  158.                2 AS TrueChatIndex$,_
  159.                1 AS SavingToDisk$, _
  160.                1 AS BBSActivity$
  161.       END SUB
  162.